Added comments indicating which parts should be removed at appropriate time
authorNatalie Boehm <nmb56@pitt.edu>
Thu, 22 Jun 2017 20:34:57 +0000 (16:34 -0400)
committerNatalie Boehm <nmb56@pitt.edu>
Thu, 22 Jun 2017 20:34:57 +0000 (16:34 -0400)
src/bin/publish.rs
tests/publish.rs

index 36b7806d9f003f170b1f83bcb185d7045b0ccad1..507496b46c2973d3c420bda7ac037b6d92f1cf9b 100644 (file)
@@ -6,7 +6,7 @@ use cargo::util::important_paths::find_root_manifest_for_wd;
 #[derive(Deserialize)]
 pub struct Options {
     flag_index: Option<String>,
-    flag_host: Option<String>,
+    flag_host: Option<String>,  // TODO: Deprecated, remove
     flag_token: Option<String>,
     flag_manifest_path: Option<String>,
     flag_verbose: u32,
@@ -28,8 +28,8 @@ Usage:
 
 Options:
     -h, --help               Print this message
-    --index INDEX            Host to upload the package to
-    --host HOST              DEPRECATED
+    --index INDEX            Registry index to upload the package to
+    --host HOST              DEPRECATED, renamed to '--index'
     --token TOKEN            Token to use when uploading
     --no-verify              Don't verify package tarball before publish
     --allow-dirty            Allow publishing with a dirty source directory
@@ -56,7 +56,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult {
     let Options {
         flag_token: token,
         flag_index: index,
-        flag_host: host,
+        flag_host: host,    // TODO: Deprecated, remove
         flag_manifest_path,
         flag_no_verify: no_verify,
         flag_allow_dirty: allow_dirty,
@@ -66,6 +66,11 @@ pub fn execute(options: Options, config: &Config) -> CliResult {
     } = options;
 
 
+    // TODO: Deprecated
+    // remove once it has been decided --host can be removed
+    // We may instead want to repurpose the host flag, as
+    // mentioned in this issue
+    // https://github.com/rust-lang/cargo/issues/4208
     let msg = "The flag '--host' is no longer valid.
 
 Previous versions of Cargo accepted this flag, but it is being
@@ -84,7 +89,7 @@ about this warning.";
         token: token,
         index:
             if host.clone().is_none() || host.clone().unwrap().is_empty() { index }
-            else { config.shell().warn(&msg)?; host },
+            else { config.shell().warn(&msg)?; host },  // TODO: Deprecated, remove
         verify: !no_verify,
         allow_dirty: allow_dirty,
         jobs: jobs,
index d2b3e748a57306f35d23732532fcd569682c1f00..166b021c7bec3401e039859ad515965f708d0f38 100644 (file)
@@ -94,6 +94,8 @@ See [..]
     }
 }
 
+// TODO: Deprecated
+// remove once it has been decided --host can be removed
 #[test]
 fn simple_with_host() {
     setup();
@@ -158,6 +160,8 @@ See [..]
     }
 }
 
+// TODO: Deprecated
+// remove once it has been decided --host can be removed
 #[test]
 fn simple_with_index_and_host() {
     setup();